﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace wallstreet
{
    public class StockInfo
    {
        public string Symbol { get; set; }
        public string Company { get; set; }
        public string StockExchange { get; set; }

        public string LastTrade { get; set; }
        public string Change_Percent { get; set; }
        public string Change_Number { get; set; }

        public string Change
        {
            get
            {
                string result = Change_Percent;

                if (Change_Percent != "" && Change_Percent != null)
                {
                    if (Change_Percent.Substring(0, 1).Equals("-"))
                        result = "▼ " + result;
                    else
                        result = "▲ " + result;
                }
                return result;
            }
        }

        public SolidColorBrush Change_color
        {
            get
            {
                SolidColorBrush color = new SolidColorBrush(Color.FromArgb(255, 0, 0, 0));

                if (Change_Percent != "" && Change_Percent != null)
                {
                    if (Change_Percent.Substring(0, 1).Equals("-"))
                        color = new SolidColorBrush(Color.FromArgb(255, 190, 17, 17));
                    else
                        color = new SolidColorBrush(Color.FromArgb(255, 0, 186, 70));
                }

                return color;
            }
        }
    }
}
